
/****** Object:  Table [Feedback]    Script Date: 07/07/2012 20:45:33 ******/
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[FK__Feedback__Feedba__15502E78]') AND parent_object_id = OBJECT_ID(N'[Feedback]'))
ALTER TABLE [Feedback] DROP CONSTRAINT [FK__Feedback__Feedba__15502E78]
GO
/****** Object:  Table [Feedback]    Script Date: 07/07/2012 20:45:33 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Feedback]') AND type in (N'U'))
DROP TABLE [Feedback]
GO
/****** Object:  Table [Feedback]    Script Date: 07/07/2012 20:45:33 ******/
PRINT 'CREATING TABLE .... [Feedback]'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF  NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Feedback]') AND type in (N'U'))
BEGIN
CREATE TABLE [Feedback](
	[FeedbackKey] [int] IDENTITY(1,1) NOT NULL,
	[FeedbackUserKey] [int] NOT NULL,
	[FeedbackText] [varchar](max) NOT NULL,
	[FeedbackDate] [datetime] NOT NULL,
	[Sys_DateOfCreation] [datetime] NOT NULL,
	[Sys_DateOfModification] [datetime] NOT NULL,
	[Sys_CreatedByID] [varchar](50) NOT NULL,
	[Sys_ModifiedByID] [varchar](50) NOT NULL,
	[Sys_DeleteType] [int] NOT NULL,
	[Sys_IsDeleted] [bit] NOT NULL,
	[Sys_OrganizationID] [int] NOT NULL,
	[Sys_InitialPrimaryKeys] [varchar](max) NULL,
	[Sys_WorkstationName] [varchar](50) NULL,
 CONSTRAINT [PK_Feedback] PRIMARY KEY CLUSTERED 
(
	[FeedbackKey] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [Feedback] SET (LOCK_ESCALATION = AUTO)
GO

ALTER TABLE [Feedback]  WITH CHECK ADD FOREIGN KEY([FeedbackUserKey])
REFERENCES [FeedbackUser] ([FeedbackUserKey])
GO